﻿@model CultuRAM.Models.Comment

@{
    ViewBag.Title = "Criar";
}

<h2>Criar</h2>

@using (Ajax.BeginForm("CreatePv", new AjaxOptions { UpdateTargetId = "tabCom" })) 
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Comment</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.CommentText)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.CommentText)
            @Html.ValidationMessageFor(model => model.CommentText)
        </div>

        <div class="editor-field hidden">
            @Html.DropDownListFor(model => model.EventId, (SelectList)ViewBag.Events)
            @Html.ValidationMessageFor(model => model.EventId)
        </div>

        <p>
            <br /><input type="submit" value="Guardar" class="btn btn-primary"/>
        </p>
    </fieldset>
}

<div>
      @Ajax.ActionLink("Voltar a Lista", "IndexPV", "Comment",  new {id = (Convert.ToInt32(Url.RequestContext.RouteData.Values["id"]))},
            new AjaxOptions
                {
                    UpdateTargetId="tabCom", 
                    InsertionMode = InsertionMode.Replace, 
                    HttpMethod = "GET" 
                }) 

</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}